<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <div th:replace="public/header :: publiceCss"></div>
</head>
<body>
<div th:replace="public/header :: publicNav"></div>
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <div>
                <h2><span class="glyphicon glyphicon-list"></span>发现</h2>
            </div>
            <hr>
            <div class="media" th:each="question : ${dataList.data}">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object img-rounded img-size-40" th:src="${question.user.avatar}"
                             src="https://static.hdslb.com/images/member/noface.gif" alt="avatar">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading">
                        <a th:href="@{'/question/' + ${question.id}}" th:text="${question.title}"></a>
                    </h4>
                    <span class="question-text-desc" th:text="${question.description}">阿斯顿骄傲的</span><br>
                    <span class="text-desc">
                        <span th:text="${question.commentCount}">0</span> 个回复 × <span
                            th:text="${question.viewCount}"></span> 次浏览 × <span
                            th:text="${#dates.format(question.createTime, 'yyyy-MM-dd HH:mm:SS')}"></span>
                    </span>
                </div>
            </div>
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li>
                        <a href="/?page=1" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li>
                        <a th:href="@{/(page=${dataList.currentPage - 1})}" aria-label="Previous">
                            <span aria-hidden="true"> <</span>
                        </a>
                    </li>
                    <li><a th:href="@{/(page=${dataList.currentPage - 1})}" th:text="${dataList.currentPage - 1}"></a>
                    </li>
                    <li th:class="active"><a th:href="@{/(page=${dataList.currentPage})}"
                                             th:text="${dataList.currentPage}"></a></li>
                    <li><a th:href="@{/(page=${dataList.currentPage + 1})}" th:text="${dataList.currentPage + 1}"></a>
                    </li>
                    <li>
                        <a th:href="@{/(page=${dataList.currentPage + 1})}" aria-label="Next">
                            <span aria-hidden="true"> ></span>
                        </a>
                    </li>
                    <li>
                        <a th:href="@{/(page=${dataList.total / 5 + 1})}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <h3>热门话题</h3>
        </div>
    </div>
</div>
</body>
</html>